import instance from '@/utils/request'

export function GetUserList(params = {}) {
    return instance.request({
        method: 'GET',
        url: '/users',
        params
    })
}

export function ChangeUserStatus(id, data = {}) {
    return instance.request({
        method: 'PUT',
        url: `/users/${id}/status`,
        data
    })
}

export function DeleteUser(id, data = {}) {
    return instance.request({
        method: 'DELETE',
        url: `/users/${id}`,
        data
    })
}

export function ResetUserPassword(id, data = {}) {
    return instance.request({
        method: 'PUT',
        url: `/users/${id}/password`,
        data
    })
}

export function CreateUser(data = {}) {
    return instance.request({
        method: 'POST',
        url: '/users',
        data
    })
}

export function UpdateUser(id, data = {}) {
    return instance.request({
        method: 'PUT',
        url: `/users/${id}`,
        data
    })
}